
package com.joysuch.wwyt.datadump.biz.model;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.zlg.common.datadump.annotation.DataDumpEntity;
import cn.zlg.common.datadump.annotation.DataDumpField;
import com.joysuch.wwyt.bp.entity.dsl.QBpSystemVideo;
import com.joysuch.wwyt.datadump.biz.convertor.ExportSystemVideoEvaluationToRiskDistrictNameConvertor;
import com.joysuch.wwyt.datadump.biz.convertor.ExportSystemVideoTypeConvertor;
import com.joysuch.wwyt.datadump.biz.convertor.ImportNameToRiskDistrictConvertor;
import com.joysuch.wwyt.datadump.biz.convertor.ImportSystemVideoTypeConvertor;
import com.joysuch.wwyt.datadump.biz.query.BpSystemVideoDumpQueryBean;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@DataDumpEntity(name = "bp-system-video-dump", entity = QBpSystemVideo.class, exportQueryConditions = BpSystemVideoDumpQueryBean.class, businessName = "视频监控")
@Data
public class BpSystemVideoDumpBean {

//    @Excel(name = "视频编号", width = 20)
//    @DataDumpField(field = "id", importKey = true)
//    private Long id;

    @NotNull
    @Pattern(regexp = "海康|大华|合凡|其它",message = "只能填写以下内容" + "\"海康|大华|合凡|其它\"")
    @Excel(name = "视频设备品牌", width = 20)
    @DataDumpField(field = "brand", importKey = true)
    private String brand;


    @NotNull
    @Length(max = 64)
    @Excel(name = "名称", width = 20)
    @DataDumpField(field = "name", importKey = true)
    private String name;

    @Pattern(regexp = "移动视频|固定视频",message = "只能填写以下内容" +"\"移动视频|固定视频\"")
    @NotNull
    @Excel(name = "设备种类", width = 20)
    @DataDumpField(field = "deviceClass")
    private String deviceClass;

    @Pattern(regexp = "H264|H265",message = "只能填写以下内容" +"\"H264|H265\"")
    @NotNull
    @Excel(name = "视频编码类型", width = 20)
    @DataDumpField(field = "codeType")
    private String codeType;

    @Pattern(regexp = "TCP|UDP",message = "只能填写以下内容" +"\"TCP|UDP\"")
    @Excel(name = "网络协议", width = 20)
    @DataDumpField(field = "protocol",importConvertors= ImportSystemVideoTypeConvertor.class,exportConvertors = ExportSystemVideoTypeConvertor.class)
    private String protocol;

    @Pattern(regexp = "摄像头|录像机",message = "只能填写以下内容" + "\"摄像头|录像机\"")
    @Excel(name = "设备类型", width = 20)
    @DataDumpField(field = "deviceType")
    private String deviceType;

    @Length(max = 50)
    @Excel(name = "账号", width = 20)
    @DataDumpField(field = "account")
    private String account;

    @Length(max = 50)
    @Excel(name = "密码", width = 20)
    @DataDumpField(field = "password")
    private String password;

    @Excel(name = "IP", width = 20)
    @DataDumpField(field = "ip")
    private String ip;

    @Excel(name = "端口号", width = 20)
    @DataDumpField(field = "port")
    private Integer port;

    @Excel(name = "通道号", width = 20)
    @DataDumpField(field = "channelNo")
    private String channelNo;


    @Excel(name = "所在风险区域", width = 20)
    @DataDumpField(field = "evaluation", exportConvertors = ExportSystemVideoEvaluationToRiskDistrictNameConvertor.class, importConvertors = ImportNameToRiskDistrictConvertor.class)
    private String evaluation;

    @Excel(name = "实时视频流地址预览", width = 20)
    @DataDumpField(field = "realTimeSite")
    private String realTimeSite;

    @Excel(name = "历史视频流地址预览", width = 20)
    @DataDumpField(field = "historySite")
    private String historySite;

    @Excel(name = "地址日期格式", width = 20)
    @DataDumpField(field = "dateFormat")
    private String dateFormat;

    @Excel(name = "地址时间格式", width = 20)
    @DataDumpField(field = "timeFormat")
    private String timeFormat;

}
